package com.example.materialviewpagerdemo.util;

import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.BaseAdapter;

import com.example.materialviewpagerdemo.R;
import com.zyao89.view.zloading.ZLoadingDialog;
import com.zyao89.view.zloading.Z_TYPE;

public class LoadingUtil{
    private ZLoadingDialog dialog;

    public LoadingUtil(ZLoadingDialog dialog) {
        this.dialog=dialog;
    }

    public void showDialog(){
        dialog.setLoadingBuilder(Z_TYPE.STAR_LOADING)//设置类型
                .setLoadingColor(Color.parseColor("#FF4081") )//颜色
                .setHintText("正在加载...")
                .setHintTextSize(16) // 设置字体大小 dp
                .setHintTextColor(Color.parseColor("#FF4081") )  // 设置字体颜色
                .setDurationTime(1) // 设置动画时间百分比 - 0.5倍
                .setDialogBackgroundColor(Color.WHITE) // 设置背景色，默认白色
                .show();
    }
    public void cancleDialog(){
        dialog.cancel();
    }

}
